﻿using PLCDataCollector.Core.Entities;
using PLCDataCollector.Core.Models;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PLCDataCollector.Services.Data
{
    public interface IDataService
    {
        List<DeviceMapping> GetDeviceMappings(string machineId);
        void SavePlcData(PlcDataHistory data);
        void BatchSavePlcData(List<PlcDataHistory> dataList);
        List<PlcDataHistory> GetRecentData(string machineId = null, int limit = 100);

        List<DeviceMappingDetail> GetList(string mamchineId, string machineid, int type, int limit = 1000);
        List<T> ExecuteLinkedStoredProcedure<T>(string server, string database, string procedure, params SugarParameter[] parameters);

        bool ChangeInfo(string MmachineId, List<GetInfoModel> infos, List<GetDetailInfoModel> detailsInfos);
        bool TestConnection();
    }
}
